let Koa = require('koa')
let Router = require('koa-router')
let views = require('koa-views')
let static = require('koa-static')
let {resolve} = require('path')
let bodyParser = require('koa-bodyparser')

let app = new Koa()
app.listen(3000)
let router = new Router()

app.use(bodyParser())
app.use(router.routes())
app.use(static(resolve(__dirname, 'static')))
app.use(views(resolve(__dirname, 'views')))

router.get('/', async (ctx, next) => {
    ctx.body = '<h3>hello world</h3>'
})